#define _CRT_SECURE_NO_WARNINGS 1

BC53 计算一元二次方程
#include <stdio.h>
#include <math.h>
double zhengen(double m, double n, double d)//实现一元二次方程求根公式函数+
{
    double x = 0;
    x = (-n + sqrt(d)) / (2 * m);
    return x;
}
double fugen(double m, double n, double d)//实现一元二次方程求根公式函数-
{
    double x = 0;
    x = (-n - sqrt(d)) / (2 * m);
    return x;
}
double shibu(double m, double n)
{
    double s = 0;
    s = (-n) / (2 * m);
    return s;
}
double xubu(double m, double d)
{
    double xu = 0;
    xu = sqrt(-d) / (2 * m);
    return xu;
}
int main()
{
    double a = 0, b = 0, c = 0,x1=0,x2=0;
    while(scanf("%lf %lf %lf", &a, &b, &c)!=EOF)
    {
        double derta = pow(b, 2) - 4 * a * c;
        if (a != 0)
        {
            if (derta == 0)
            {
                x1 = x2 = zhengen(a,b,derta);
                printf("x1=x2=%.2lf\n", x1);
            }
            else if (derta > 0)
            {
                x1 =( zhengen(a, b, derta)> fugen(a, b, derta)) ? fugen(a, b, derta) : zhengen(a, b, derta);
                x2 =(zhengen(a, b, derta) > fugen(a, b, derta)) ? zhengen(a, b, derta) : fugen(a, b, derta);
                printf("x1=%.2lf;x2=%.2lf\n",x1,x2);
            }
            else if (derta < 0)
            {
 
                printf("x1=%.2lf-%.2lfi;x2=%.2lf+%.2lfi\n",shibu(a, b),xubu(a, derta), shibu(a, b), xubu(a, derta));
            }
        }
        else
        {
            printf("Not quadratic equation");
        }
    }
    return 0;
}


#include<stdio.h>

int pd_ruin(int n)
{
    if (n % 4 == 0)
        if (n % 100 != 0)
            return 29;

    if (n % 400 == 0)
        return 29;

    return 28;
}

int main()
{
    int nian = 0, yue = 0;
    int t = 0;//天数
    while ((scanf("%d %d", &nian, &yue)) != EOF)
    {

        switch (yue)
        {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            t = 31;
            printf("%d\n", t);

            break;
        case 4:
        case 6:
        case 9:
        case 11:
            t = 30;
            printf("%d\n", t);

            break;
        case 2:
            t = pd_ruin(nian);
            printf("%d\n", t);

            break;
        }
    }

    return 0;
}